package com.dau.entity.system.user;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.dau.entity.BaseEntity;
import com.dau.entity.system.dept.SysDept;
import jakarta.validation.constraints.NotBlank;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serial;
import java.util.List;

@TableName("sys_user")
@EqualsAndHashCode(callSuper = true)
@Data
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
public class SysUser extends BaseEntity {

    @Serial
    private static final long serialVersionUID = 1L;
    private Long id;
    /**
     * 用户名
     */
    @NotBlank(message = "用户名不能为空")
    private String userName;
    /**
     * 名称
     */
    @NotBlank(message = "用户名称不能为空")
    private String name;
    /**
     * 电话
     */
    @NotBlank(message = "用户电话不能为空")
    private String phone;
    /**
     * 密码
     */
    @NotBlank(message = "用户密码不能为空")
    private String password;
    /**
     * 部门列表
     */
    @TableField(exist = false)
    private List<SysDept> deptList;
    /**
     * 角色对象
     */
    @TableField(exist = false)
    private List<SysRole> roles;
}
